import time

def iui(mas):
      qwe = True
      while qwe:
            qwe = False
            for i  in range(len(mas) -1):
                  if int(mas[i]) > int(mas[i+1]):
                        mas[i],mas[i+1] = mas[i+1],mas[i]
                        qwe = True
      return mas
def timesort (mas):
    t_start = time.time()
    x = iui (mas)
    t_finish = time.time()
    print("Время", round((t_finish-t_start)) * 1000, 'мc')
          
f = open ('m3_shuffle.txt')
f1 = open('m1_sorted.txt')
f2 = open('m2_reverse.txt')
array = f.readlines()
array1 = f1.readlines()
array2 = f2.readlines()

timesort (array)
timesort (array1)
timesort (array2)
